package resources;
import java.awt.BorderLayout;

import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.WindowConstants;
import javax.swing.table.DefaultTableColumnModel;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class TableTaker extends javax.swing.JFrame {
	
	private static final Logger log = LoggerFactory.getLogger(TableTaker.class);
	
	private JPanel dispPanel;
	private JTable jTable1;
	private JScrollPane scroller;

	/**
	* Auto-generated main method to display this JFrame
	*/
	public static void main(String[] args) {
		TableTaker inst = new TableTaker();
		inst.setVisible(true);
	}
	
	public TableTaker() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			{
				dispPanel = new JPanel();
				BorderLayout dispPanelLayout = new BorderLayout();
				dispPanel.setLayout(dispPanelLayout);
				getContentPane().add(dispPanel, BorderLayout.CENTER);
				{
					scroller = new JScrollPane();
					dispPanel.add(scroller, BorderLayout.CENTER);
					{
						TableModel jTable1Model = new DefaultTableModel(
							new String[][] { { "One", "Two" },
									{ "Three", "Four" } },
							new String[] { "Column 1", "Column 2" });
						jTable1 = new JTable();
						scroller.setViewportView(jTable1);
						jTable1.setModel(jTable1Model);
						jTable1.setPreferredSize(new java.awt.Dimension(392, 49));
						DefaultTableColumnModel columnModel = new DefaultTableColumnModel();
//						JTableRowHeader rowHeader = new JTableRowHeader(columnModel);
//						JTable table = new JTable();
//						rowHeader.setTable(table);
//						JScrollPane scroller = new JScrollPane();
//						scroller.setViewportView(table);
//						scroller.setRowHeaderView(rowHeader);
					}
				}
			}
			pack();
			setSize(400, 300);
		} catch (Exception e) {
			log.error("", e);
		}
	}

}
